let texiao = document.querySelector("#texiao");
let num = 0;
let xxx=document.querySelector("#register>.div2>h2");
texiao.onclick = e => {
    num++;
    if (num % 2 == 1) {
        xxx.innerHTML="再次点击关闭特效=>";
        onmousemove = function (e) {
            let img = document.createElement("img");
            let x = e.pageX;
            let y = e.pageY;
            let r = parseInt(Math.random() * 20 + 1)
            img.style.pointerEvents = "none";
            img.className = "animation";
            img.src = `./images/1 (${r}).png`;
            img.style.position = "absolute";
            img.style.width = "40px";
            img.style.height = "40px";
            img.style.top = y + "px";
            img.style.left = x + "px";
            img.style.transition = "all 2.8s";
            img.style.zIndex = "100";
            img.onload = function () {
                img.style.transform = `rotate(360deg) scale(2)`;
                img.style.opacity = `0`;
            }
            bd.appendChild(img);
        }
        setInterval(() => {
            let imgs = document.querySelectorAll(".animation")
            for (var i = 0; i < imgs.length - 20; i++) {
                imgs[i].remove();
            }
        }, 100);
    } else {
        xxx.innerHTML="点击开右侧图标开启花里胡哨模式=>";
        let imgs = document.querySelectorAll(".animation")
        for (var i = 0; i < imgs.length; i++) {
            imgs[i].remove();
        }
        onmousemove = e = {}
    }
}
